@extends('layouts.admin')
@push('morecss')
    <!-- jsTree -->
    <link href="//cdn.tudouyu.cn/jstree/dist/themes/default/style.min.css" rel="stylesheet">
@endpush

@push('morescript')
    <!-- jsTree -->
    <script src="//cdn.tudouyu.cn/jstree/dist/jstree.min.js"></script>
    <script type="application/javascript">
        let page_params = {
            @can('admin.sysuser.index')
            url_list : '{{ route('admin.sysuser.index') }}',
            @endcan
            @can('admin.sysuser.create')
            url_add : '{{ route('admin.sysuser.create') }}',
            @endcan
            @can('admin.sysuser.update')
            url_edit : '{{ route('admin.sysuser.update') }}',
            @endcan
            @can('admin.sysuser.editrole')
            url_editrole : '{{ route('admin.sysuser.editrole') }}',
            @endcan
            @can('admin.sysuser.changestatus')
            url_changestatus : '{{ route('admin.sysuser.changestatus') }}',
            @endcan
            data_role : @json($roleList),
        }
    </script>
    <!-- require page js -->
    <script src="{{ mix('js/admin/sysuser_index.js') }}"></script>
@endpush
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight ecommerce">
        <div class="ibox-content m-b-sm border-bottom">
            <div class="row">
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">状态</label>
                        <select class="form-control input-s-sm inline" name="status" id="status">
                            <option value="-1">请选择</option>
                            <option value="0">激活</option>
                            <option value="1">禁用</option>
                        </select>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="control-label" for="product_name">关键字</label>
                        <input type="text" id="keyword" name="keyword" value="" placeholder="请输入搜索关键字"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">&nbsp;&nbsp;</label>
                        <div>
                            <button class="btn btn-primary" type="button" id="btn-search"><i class="fa fa-search"></i>
                                搜索
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="toolbar" class="col-sm-2">
            @can('admin.sysuser.create')
                <button class="btn btn-primary" id="btn-add"><i class="fa fa-plus"></i> 添加用户</button>
            @endcan
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <table id="table" data-classes="table table-no-bordered">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 用户编辑 -->
    <div class="ibox-content" id="box-form" style="display: none;">
        <form method="POST" class="form-horizontal" action="">
            <input type="hidden" name="id" id="id" value="">
            <div class="form-group">
                <label class="col-sm-2 control-label">昵称</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="name" id="name" required value="">
                    <span class="help-block m-b-none">用户昵称</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">登录邮箱</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="email" id="email"  value="">
                    <span class="help-block m-b-none">用于登录系统</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="password" name="password" value="" placeholder="请输入密码" value="">
                    <span class="help-block m-b-none">留空则表示不更改密码</span>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-4">
                    <button class="btn btn-primary btn-sub" type="button">
                        保存
                    </button>
                </div>
            </div>
        </form>
    </div>

    <!--用户角色编辑-->
    <div class="ibox-content" id="box-form-role" style="display: none;">
        <form id="roleform" method="POST" class="form-horizontal" action="">
            <input type="hidden" name="user_id" id="user_id" value="">
            <div class="form-group">
                <div id="jstree">
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-4">
                    <button class="btn btn-primary btn-sub" type="button">
                        保存
                    </button>
                </div>
            </div>
        </form>
    </div>
@endsection